package Chapter9;
import java.awt.*;
import java.awt.event.*;
public class Example05 {
	public static void main(String[] args) {
		final Frame f=new Frame("WindowEvent");
		f.setSize(400,300);
		f.setLocation(300, 200);
		f.setVisible(true);
		f.addWindowListener(new WindowListener() {
			public void windowOpened(WindowEvent e) {
				System.out.println("open");
			}
			public void WindowIconified(WindowEvent e) {
				System.out.println("图标化");
			}
			public void WindowDeiconified(WindowEvent e) {
				System.out.println("取消图标化");
			}
			public void WindowDeactivated(WindowEvent e) {
				System.out.println("停运");
			}
			
			public void windowClosing(WindowEvent e) {
				System.out.println("close");
				((Window)e.getComponent()).dispose();
			}
			
			public void WindowClosed(WindowEvent e) {
				System.out.println("关闭");
			}
			public void WindowActivated(WindowEvent e) {
				System.out.println("激活");
			}
		
			
		});
	}

}
